/**
 *
 */
package com.angel.io.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.angel.io.type.rows.ImportRowFile;
import com.angel.io.type.rows.impl.HeaderRowFile;

/**
 * @author William
 *
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.METHOD})
public @interface RowProcessor {

	/**
	 * Define columns number's parameters to include in the invocation method.
	 * Position is a reference to positions at columns in {@link RowProcessorCommand} definition. 
	 * </br>
	 * Minimum number parameters is 1, and maximum must be columns definition length at row processor command.
	 * </br>
	 * By default if it a empty array, row processor method must have all columns 
	 * definition at {@link RowProcessorCommand} and with its order definition.    
	 * 
	 * @return an int array which have all columns number to invoke row processor method.
	 * 
	 * @see RowProcessorCommand#columnsRow()
	 */
	public int[] columnsParameters();

	/**
	 * Define domain object class to process in each row.  When it is different of {@link Object} class,
	 * it creates an instance object and, it is passed by argument at {@link RowProcessor} method invocation.
	 * </br>  
	 * By default domain object instance isn't passed by argument.
	 * </br>
	 * 
	 * @return a domain object class.
	 */
	public Class<?> object() default Object.class;

	/**
	 * It defines if in the row processor method invocation, import row instance is passed by 
	 * argument.
	 * 
	 * @return <code>true</code> if a {@link ImportRowFile} implementation instance is passed by argument at row processor method invocation. Otherwise, it isn't passed.
	 */
	public boolean importRow() default false;

	/**
	 * It defines if in row processor method invocation, header row file instance is passed by argument.
	 * 
	 * @return <code>true</code> if a {@link HeaderRowFile} implementation instance is passed by argument at row processor method invocation. Otherwise, is isn't passed.
	 */
	public boolean headerRow() default false;
	
	/**
	 * Indicates if domain object class attributes are injected automatically.
	 * If it is <code>true</code>, it must defines a domain object class different of object class.
	 * Columns names definition at {@link RowProcessorCommand} must be equals domain object class attributes names.
	 *   
	 * @return <code>true</code> if it injects domain object attributes automatically. Otherwise domain object attributes aren't injected.  
	 */
	public boolean inject() default false;

}
